Improve struct packing in various places
authorMatthias Clasen <mclasen@redhat.com>
Sun, 22 Sep 2013 03:37:48 +0000 (23:37 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Sun, 22 Sep 2013 03:50:55 +0000 (23:50 -0400)
19 files changed:
gtk/gtkapplication.c
gtk/gtkapplicationwindow.c
gtk/gtkcontainer.c
gtk/gtkcssanimationprivate.h
gtk/gtkcssimagescaledprivate.h
gtk/gtkentry.c
gtk/gtkentryprivate.h
gtk/gtkimage.c
gtk/gtklevelbar.c
gtk/gtkmenubutton.c
gtk/gtkplacessidebar.c
gtk/gtkrbtree.h
gtk/gtkstylecontext.c
gtk/gtktreemodelsort.c
gtk/gtktreestore.c
gtk/gtktreeview.c
gtk/gtktreeviewcolumn.c
gtk/gtkwidget.c
gtk/gtkwidgetpath.c

index 2727ece8561877cc3b0b597303cd27bd2928d5d5..0da7bfc9aee28d7ea2e5fbe5a32d2152772ae99d 100644 (file)
@@ -141,12 +141,14 @@ struct _GtkApplicationPrivate
 {
   GList *windows;
 
-  gboolean register_session;
-
   GMenuModel      *app_menu;
   GMenuModel      *menubar;
 
+  gboolean register_session;
+
 #ifdef GDK_WINDOWING_X11
+  guint next_id;
+
   GDBusConnection *session_bus;
   const gchar     *application_id;
   const gchar     *object_path;
@@ -154,10 +156,8 @@ struct _GtkApplicationPrivate
   gchar           *app_menu_path;
   guint            app_menu_id;
 
-  gchar           *menubar_path;
   guint            menubar_id;
-
-  guint next_id;
+  gchar           *menubar_path;
 
   GDBusProxy *sm_proxy;
   GDBusProxy *client_proxy;
index 5d931beefd725449c798dd933c6af2e822be4d5a..c0bf5b6783c81d9a33d830b04448690b08ceff45 100644 (file)
@@ -221,9 +221,9 @@ struct _GtkApplicationWindowPrivate
   GSList *accel_closures;
   guint accel_map_changed_id;
 
+  gboolean show_menubar;
   GMenu *app_menu_section;
   GMenu *menubar_section;
-  gboolean show_menubar;
 
   GDBusConnection *session;
   gchar           *object_path;
index 84dcd84cccca10f49558dcf503d9d6546de3a5b4..b3b1094223e3da9599d70cd6048a466530272568 100644 (file)
@@ -236,8 +236,8 @@ struct _GtkContainerPrivate
 {
   GtkWidget *focus_child;
 
-  guint resize_handler;
   GdkFrameClock *resize_clock;
+  guint resize_handler;
 
   guint border_width : 16;
 
index 08dc663ca6d91178f434fe085ec10f0d7a7089d3..928b6147ff42fd7131b8bef22efc7696ca4f9723 100644 (file)
@@ -45,10 +45,10 @@ struct _GtkCssAnimation
   GtkCssValue     *ease;
   gint64           timestamp;           /* elapsed time when paused, start time when playing (can be negative) */
   gint64           duration;            /* duration of 1 cycle */
+  double           iteration_count;
   GtkCssDirection  direction;
   GtkCssPlayState  play_state;
   GtkCssFillMode   fill_mode;
-  double           iteration_count;
 };
 
 struct _GtkCssAnimationClass
index ec1b6697c84334bfb92fa49f910424fa0701f3f2..b415d08217586cb07ae649d10c2f2fdbca2e0ed4 100644 (file)
@@ -38,9 +38,10 @@ struct _GtkCssImageScaled
 {
   GtkCssImage parent;
 
-  int          scale;
   GtkCssImage **images;
   int          n_images;
+
+  int          scale;
 };
 
 struct _GtkCssImageScaledClass
index 01fa816f55d773977b1398f00062cc12d41e15be..d124b46c33ae51b2ee9430a29fdaa8aa2a4a42a1 100644 (file)
@@ -234,10 +234,9 @@ struct _EntryIconInfo
   guint in_drag        : 1;
   guint pressed        : 1;
 
-  GtkIconHelper *icon_helper;
-
-  GtkTargetList *target_list;
   GdkDragAction actions;
+  GtkTargetList *target_list;
+  GtkIconHelper *icon_helper;
 };
 
 struct _GtkEntryPasswordHint
index 9d6f1e97e2b9707d4797ac2861a5a0c9a8a45c7e..7e84d06c7c3cea68b908ce11c73983c1af030dcf 100644 (file)
@@ -34,7 +34,6 @@ struct _GtkEntryCompletionPrivate
   GtkTreeViewColumn *column;
   GtkTreeModelFilter *filter_model;
   GtkListStore *actions;
-  gboolean first_sel_changed;
   GtkCellArea *cell_area;
 
   GtkEntryCompletionMatchFunc match_func;
@@ -43,7 +42,6 @@ struct _GtkEntryCompletionPrivate
 
   gint minimum_key_length;
   gint text_column;
-  gint current_selected;
 
   gchar *case_normalized_key;
 
@@ -57,6 +55,9 @@ struct _GtkEntryCompletionPrivate
   gulong changed_id;
   gulong insert_text_id;
 
+  gint current_selected;
+
+  guint first_sel_changed : 1;
   guint ignore_enter      : 1;
   guint has_completion    : 1;
   guint inline_completion : 1;
index a6b6572686e399949d84892a2efcb24d93aaa2c0..5128c0e35db597649a803959d48a3716f8f2d3c0 100644 (file)
@@ -136,13 +136,13 @@ struct _GtkImagePrivate
 {
   GtkIconHelper *icon_helper;
 
-  gint animation_timeout;
   GdkPixbufAnimationIter *animation_iter;
+  gint animation_timeout;
+
+  float baseline_align;
 
   gchar                *filename;       /* Only used with GTK_IMAGE_ANIMATION, GTK_IMAGE_PIXBUF */
   gchar                *resource_path;  /* Only used with GTK_IMAGE_PIXBUF */
-
-  float baseline_align;
 };
 
 
index 744ee2cd2259841a8ff829ec9d167004657a173f..6a1a7068e526a9a2c569782cd099f2346a5c777c 100644 (file)
@@ -136,14 +136,14 @@ typedef struct {
 struct _GtkLevelBarPrivate {
   GtkOrientation orientation;
 
+  GtkLevelBarMode bar_mode;
+
   gdouble min_value;
   gdouble max_value;
   gdouble cur_value;
 
   GList *offsets;
 
-  GtkLevelBarMode bar_mode;
-
   guint inverted : 1;
 };
 
index d185a310cf8b92dea5e253d8d3dd16b1e6697815..60573dacc19deec30fc68bc5c214870a5194502a 100644 (file)
@@ -160,9 +160,9 @@ struct _GtkMenuButtonPrivate
   GtkMenuButtonShowMenuCallback func;
   gpointer user_data;
 
-  GtkArrowType arrow_type;
   GtkWidget *align_widget;
   gpointer arrow_widget;
+  GtkArrowType arrow_type;
 };
 
 enum
index a019dcdde48087b1b34a8f8ee922274bdd0cdf42..d38d38d56040fc26731baedc60095a951b590502 100644 (file)
@@ -144,16 +144,12 @@ struct _GtkPlacesSidebar {
 
        /* DnD */
        GList     *drag_list; /* list of GFile */
-       gboolean  drag_data_received;
        int       drag_data_info;
-       gboolean  drop_occured;
-
-       GtkWidget *popup_menu;
 
        /* volume mounting - delayed open process */
-       gboolean mounting;
        GtkPlacesOpenFlags go_to_after_mount_open_flags;
 
+       GtkWidget *popup_menu;
        GSList *shortcuts;
 
        GDBusProxy *hostnamed_proxy;
@@ -165,9 +161,12 @@ struct _GtkPlacesSidebar {
        DropState drop_state;
        int new_bookmark_index;
        guint drag_leave_timeout_id;
-       guint switch_location_timer;
        char *drop_target_uri;
+       guint switch_location_timer;
 
+       guint mounting : 1;
+       guint  drag_data_received : 1;
+       guint drop_occured : 1;
        guint show_desktop : 1;
        guint show_connect_to_server : 1;
 };
index a1b27a2406550ca3900937379386ea01764a8fd9..9e088a1b18d1a5cb8ff7949600e543b377876645 100644 (file)
@@ -63,14 +63,15 @@ struct _GtkRBNode
 {
   guint flags : 14;
 
-  GtkRBNode *left;
-  GtkRBNode *right;
-  GtkRBNode *parent;
-
   /* count is the number of nodes beneath us, plus 1 for ourselves.
    * i.e. node->left->count + node->right->count + 1
    */
   gint count;
+
+  GtkRBNode *left;
+  GtkRBNode *right;
+  GtkRBNode *parent;
+
   /* count the number of total nodes beneath us, including nodes
    * of children trees.
    * i.e. node->left->count + node->right->count + node->children->root->count + 1
index f20505964b86799ea3e16c23d973147a45ee854d..cf7ea20f2dd2e4b3a59354bd6099d83497972f23 100644 (file)
@@ -365,8 +365,8 @@ struct _GtkStyleContextPrivate
   GtkStyleInfo *info;
   gint scale;
 
-  GdkFrameClock *frame_clock;
   guint frame_clock_update_id;
+  GdkFrameClock *frame_clock;
 
   GtkCssChange relevant_changes;
   GtkCssChange pending_changes;
index 4033dbbc5ea1ac4cec4abca38d1f072bdb198e4e..7e5dc57fca4c9896bcdd2d7f59a6e556c42a1266 100644 (file)
@@ -228,8 +228,8 @@ struct _SortElt
   gint           offset;
   gint           ref_count;
   gint           zero_ref_count;
-  GSequenceIter *siter; /* iter into seq */
   gint           old_index; /* used while sorting */
+  GSequenceIter *siter; /* iter into seq */
 };
 
 struct _SortLevel
@@ -247,8 +247,8 @@ struct _SortData
   gpointer sort_data;
 
   GtkTreePath *parent_path;
-  gint parent_path_depth;
   gint *parent_path_indices;
+  gint parent_path_depth;
 };
 
 /* Properties */
index de76a8f045b8a0344fc8bc10594d2913bf4320f4..bbf6e5d9a99472e0915df7f39f809012ddb6c857 100644 (file)
 struct _GtkTreeStorePrivate
 {
   gint stamp;
+  GtkSortType order;
   gpointer root;
   gpointer last;
   gint n_columns;
   gint sort_column_id;
   GList *sort_list;
-  GtkSortType order;
   GType *column_headers;
   GtkTreeIterCompareFunc default_sort_func;
   gpointer default_sort_data;
index 718174c47fcdeb02dbf0f77dc9326cf1d72f7eca..d22836012014e8e13c3c65e3695da05f82ed019c 100644 (file)
@@ -294,6 +294,8 @@ struct _GtkTreeViewPrivate
   GList *children;
   gint width;
 
+  guint presize_handler_tick_cb;
+
   /* Adjustments */
   GtkAdjustment *hadjustment;
   GtkAdjustment *vadjustment;
@@ -313,7 +315,6 @@ struct _GtkTreeViewPrivate
   /* we cache it for simplicity of the code */
   gint dy;
 
-  guint presize_handler_tick_cb;
   guint validate_rows_timer;
   guint scroll_sync_timer;
 
@@ -364,9 +365,9 @@ struct _GtkTreeViewPrivate
   GtkTreeSelection *selection;
 
   /* Header information */
+  gint header_height;
   gint n_columns;
   GList *columns;
-  gint header_height;
 
   GtkTreeViewColumnDropFunc column_drop_func;
   gpointer column_drop_func_data;
@@ -376,6 +377,9 @@ struct _GtkTreeViewPrivate
 
   gint prev_width_before_expander;
 
+  /* Scroll timeout (e.g. during dnd, rubber banding) */
+  guint scroll_timeout;
+
   /* Interactive Header reordering */
   GdkWindow *drag_window;
   GdkWindow *drag_highlight_window;
@@ -396,9 +400,6 @@ struct _GtkTreeViewPrivate
   gpointer destroy_count_data;
   GDestroyNotify destroy_count_destroy;
 
-  /* Scroll timeout (e.g. during dnd, rubber banding) */
-  guint scroll_timeout;
-
   /* Row drag-and-drop */
   GtkTreeRowReference *drag_dest_row;
   GtkTreeViewDropPosition drag_dest_pos;
@@ -411,15 +412,15 @@ struct _GtkTreeViewPrivate
   gint rubber_band_extend;
   gint rubber_band_modify;
 
+  /* fixed height */
+  gint fixed_height;
+
   GtkRBNode *rubber_band_start_node;
   GtkRBTree *rubber_band_start_tree;
 
   GtkRBNode *rubber_band_end_node;
   GtkRBTree *rubber_band_end_tree;
 
-  /* fixed height */
-  gint fixed_height;
-
   /* Scroll-to functionality when unrealized */
   GtkTreeRowReference *scroll_to_path;
   GtkTreeViewColumn *scroll_to_column;
index ff3b46c9035155eca0318da0f54f7b2797da3733..ea16706e328fe731c89ac375ffc06221105c0e56 100644 (file)
@@ -133,8 +133,8 @@ struct _GtkTreeViewColumnPrivate
   GtkWidget *arrow;
   GtkWidget *alignment;
   GdkWindow *window;
-  gfloat xalign;
   gulong property_changed_signal;
+  gfloat xalign;
 
   /* Sizing fields */
   /* see gtk+/doc/tree-column-sizing.txt for more information on them */
index c49fb57e57367880331f185d56610b1ab69c8000..b29396e9714cb6725732be3e6de2a84cd6e00fd3 100644 (file)
@@ -524,9 +524,9 @@ struct _GtkWidgetPrivate
 
 struct _GtkWidgetClassPrivate
 {
+  GtkWidgetTemplate *template;
   GType accessible_type;
   AtkRole accessible_role;
-  GtkWidgetTemplate *template;
 };
 
 enum {
index 855902fd6835e09ebb35d4f9659bb294ab692962..342ddeccf6f12c68f4d89344f60912f697006a1d 100644 (file)
@@ -89,10 +89,10 @@ struct GtkPathElement
 {
   GType type;
   GQuark name;
+  guint sibling_index;
   GHashTable *regions;
   GArray *classes;
   GtkWidgetPath *siblings;
-  guint sibling_index;
 };
 
 struct _GtkWidgetPath